# -*- coding: utf-8 -*-
# Author: xiantingDeng
# File: env_util.py
# Time: 10:19


from common.utils.file_util import get_real_ini_dir
from common.utils.read_util import OperationIni


class EnvionMent():
    def __init__(self):
        self.file_path = get_real_ini_dir("env.ini")
        self.env = OperationIni(self.file_path).get_ini_file_path_section_data("environment")

    def get_env_data(self):
        try:
            if self.env.get("current_env") == "prod":
                return True
            elif self.env.get("current_env") == "test":
                return False
            else:
                print("运行环境选择错误，请检查{}配置文件是否正常".format(self.file_path))
        except:
            raise



